package com.cameron.serviceedu.client;

import com.cameron.entity.*;
import com.cameron.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@FeignClient("service-ucenter")
public interface UserCenterClient {

    /**
     * 调用eduComment模块中的方法，获取当前登录用户的信息
     *
     * @param request
     * @return
     */
    @GetMapping("/service-user/member/getMemberInfo")
    Result getInfo(HttpServletRequest request);

    @PostMapping("/service-user/member/saveTeacherAsMember")
    void saveTeacherAsMember(@RequestBody EduTeacher teacher);

    @PostMapping("/service-user/member/changeRole/{memberId}/{role}")
    boolean changeUserRole(@PathVariable("memberId") String memberId, @PathVariable("role") Integer role);

    @PostMapping("/service-user/member/backend/login")
    BackendMemberDto backendLogin(@RequestBody BackendLoginVo loginVo);
}
